package com.livestocksolutions;

/* -- Version History --
 *  1.0 : 10 July 2012 - Initial version.
 *
 *  1.1 : 16 July 2012 - Class now implements Serializable
 */

/**
 * This class contains data for an Address contact.
 *  
 * @author Adam Parr
 * @version 1.1
 * 
 * @.modified 16 July 2012
 */
public class ContactAddress extends ContactDetail {
	/**
	 * Version number of class and value to determine un-serialised class compatibility
	 */
	private static final long serialVersionUID = 11L;
	/**
	 * Street address of contact.
	 * Such as "123 Xyz Drive"
	 */
	protected String street;
	/**
	 * Town of contact address
	 */
	protected String town;
	/**
	 * postcode of the town
	 */
	protected int postcode;
	
	/**
	 * Constructor
	 */
	public ContactAddress(){
		super();
		type="Address";
	}
	
	/**
	 * Get the street address from this contact
	 * @return street address
	 */
	public String getStreet(){
		return street;
	}
	/**
	 * Get the town name from this contact
	 * @return town name
	 */
	public String getTown(){
		return town;
	}
	/**
	 * Get the postcode from this contact
	 * @return postcode, should be related to the town
	 */
	public int getPostcode(){
		return postcode;
	}
	/**
	 * Change the street address of this contact
	 * @param street new street address
	 */
	public void  setStreet(String street){
		this.street=street;
	}
	/**
	 * Change the town name of this contact
	 * @param town new name of town
	 */
	public void  setTown(String town){
		this.town=town;
	}
	/**
	 * Change the postcode of the town
	 * @param postcode new postcode associated with the town
	 */
	public void  setPostcode(int postcode){
		this.postcode=postcode;
	}
	
	@Override
	public String  getValue(){
		return street +", "+ town + " " + postcode;
	}
}
